''' Mission 7 - Personal Billboard Medium Remix 3B This remix uses two lists that are subject related. Each list has seven items. It can be any number, but they should each have the same number of items. The English list shows how to print on multiple lines. This only works with display.print(), not display.show(). Because print statements keep printing, there is a sleep followed by a clear so it doesn't just scroll down the screen continuously. -It also includes the button to break the loop and end the program- ''' from codex import * from time import sleep choice = 0 my_english = ["Noun: \nperson, place, thing\npirate, apple, bird", "Pronoun: \nstands in for noun\nI, you, he" "Adjective: \ndescribes a noun\nblue, funny, cute", "Verb: \naction \neat, sing, jump", "Adverb: \ndescribes a verb\nquickly, loudly, very", "Preposition: \nshows a relationship\nto, in, from", "Conjunction: \njoins words\nand, but, or"] my_science = ["Around 2900 BC King Menes united the 2 parts of Egypt. ", "The capital of early Egypt was Memphis.", "The Old Kingdom of Egypt lasted from 2575 to 2130 BC.", "The great pyramids were built during the Old Kingdom.", "The Middle Kingdom was a period of art and architecure.", "A mighty pharaoh of the New Kingdom was Thutmose III.", "During the New Kingdom, Ramses II carried out a vast building program."] LAST_INDEX = len(my_english) - 1 my_list = my_english while True: # display the fact, wait, and then clear screen my_fact = my_list[choice] display.print(my_fact) sleep(2) display.clear() # select the list to display if buttons.was_pressed(BTN_A): my_list = my_english if buttons.was_pressed(BTN_B): my_list = my_science # scroll forward and backward if buttons.was_pressed(BTN_L): choice = choice - 1 if choice < 0: choice = LAST_INDEX if buttons.was_pressed(BTN_R): choice = choice + 1 if choice > LAST_INDEX: choice = 0 # break out of the loop to quit if buttons.was_pressed(BTN_D): break